//
//  UIBarButton+Extension.swift
//  swiftWEIbo
//
//  Created by mac－gt on 15/11/26.
//  Copyright © 2015年 mac－gt. All rights reserved.
//

import UIKit
extension UIBarButtonItem{
    convenience init(imageNmae:String){
        let button=UIButton()

    button.setImage(UIImage(named: imageNmae), forState: UIControlState.Normal)
        button.setImage(UIImage(named: "\(imageNmae)_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        self.init(customView:button)
    }
    class func navigaitonItem(imageName: String) -> UIBarButtonItem {
        let button = UIButton()
        button.setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        button.setImage(UIImage(named: "\(imageName)_highlighted"), forState: UIControlState.Highlighted)
        button.sizeToFit()
        return UIBarButtonItem(customView: button)
    }

}